#include<stdio.h>
#include<math.h> 
struct TDate
{
	int year,month,day;
};
struct TTime
{
	int hour,min,second;
};
int main()
{
	int i;
	struct TDate date[2];
	struct TTime time[2];
	for(i=0;i<2;i++)
	{
	scanf("%d/%d/%d %d:%d:%d",&date[i].year,&date[i].month,&date[i].day
	,&time[i].hour,&time[i].min,&time[i].second);
    }
    int a=date[1].year*365+date[1].month*30+date[1].day;
    int b=date[0].year*365+date[0].month*30+date[0].day;
    int c=abs(a-b);
    if(date[1].year==date[0].year)
    {
    printf("-%04d/%02d/%02d ",c/365,c%365/30,c%365%30);
    }
    else
        printf("-%04d/%02d/%02d ",c/365,c%365/30,c%365%30);
    int d=time[1].hour*3600+time[1].min*60+time[1].second;
    int e=time[0].hour*3600+time[0].min*60+time[0].second;
    int f=abs(d-e);
    printf("%02d:%02d:%02d",f/3000,f%3600/60,f%3600%60);
    return 0;
} 
